using B.S.NewMedical.ErrorCode;
using MediatR;

namespace B.S.NewMedical.Api.Write.Application.Command.Doctor
{
    /// <summary>
    /// 创建开单申请命令
    /// </summary>
    public class CreatePrescriptionCommand : IRequest<ApiResult<int>>
    {
        /// <summary>
        /// 医院ID
        /// </summary>
        public int HospitalId { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 申请原因
        /// </summary>
        public string ApplyReason { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        public decimal TotalAmount { get; set; }
        /// <summary>
        /// 审核人 ID，关联到医生表
        /// </summary>
        public int AuditorId { get; set; } = 1;

        /// <summary>
        /// 开单明细列表
        /// </summary>
        public List<PrescriptionDetailDtos> Details { get; set; }
    }

    /// <summary>
    /// 开单明细DTO
    /// </summary>
    public class PrescriptionDetailDtos
    {
        /// <summary>
        /// 项目类型，1 表示药品，2 表示检查，3 表示检验
        /// </summary>
        public int ItemType { get; set; }

        /// <summary>
        /// 项目ID（药品ID、检查项目ID或检验项目ID）
        /// </summary>
        public int ItemId { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal Amount { get; set; }
    }
} 